<%@page import="com.zhiyou.bbs01.User"%>
<%@page import="com.zhiyou.bbs01.UserDao"%>
<%@page import="com.zhiyou.bbs01.Message"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.zhiyou.bbs01.MessageDao"%>
<%@page import="com.zhiyou.bbs01.Title"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>title_bottom</title>
<link rel="stylesheet" type="text/css" href="/bbs/css/title_2.css"/>
</head>
<body>
	<%
		Title t = (Title)request.getSession().getAttribute("clickTitle");//获取用户当前点击的话题对象
		MessageDao md = new MessageDao();//创建留言dao层对象
		UserDao ud = new UserDao();//获取用户dao层对象
		ArrayList<Message> list = md.getTitleMessage(t.getTid());//获取该话题的所有留言
	%>
<!-- 	<div> -->
	<div class="tit_message">
		<% for(Message m : list){
			User u = ud.selectOne_1(m.getUid());
			%>
			<table class="All_table1">
				<tr style="border: 1px solid;">
					<th style="text-align: left;background-color: #66CCFF; ">留言者：<a href="/bbs/userTitle_servlet?uid=<%=String.valueOf(u.getUid()) %>" > <%=u.getUname() %></a></th>
					<th style="text-align: right;background-color: #66CCFF;">日期：<%=m.getMcteate_time() %></th>
				</tr>
				<tr>
					<td colspan="2" style="background-color: #3399FF;"><%=m.getMconnect() %></td>
				</tr>
				<tr>
					<td colspan="2" style="background-color: #3399FF;">
						<form style="float: right;" action="/bbs/MessageXu_servlet?MID=<%=m.getMID() %>" onsubmit="history.go(0)" method="post">
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="red"><%=m.getMxu() %></font><input type="submit" value="踩"/>
						</form>
						<form style="float: right;" action="/bbs/MessageZan_servlet?MID=<%=m.getMID() %>" method="post">
							<font color="red"><%=m.getMzan() %></font><input type="submit" onsubmit="history.go(0)" value="赞"/>
						</form>
					</td>
				</tr>
			</table>
			<%} %>
		</div>
<!-- 	</div> -->
		
</body>
</html>